package com.unsiv.helicopter;

import android.app.Activity;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.content.res.Configuration;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnLongClickListener;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ImageView;

/**
 * <p>
 * 初始界面
 * </p>
 * 
 * @author fanzhen
 * @time 10:37:08 AM Oct 25, 2011
 * @email fanzhen.meng@gmail.com
 * @qq 474146502
 * @phone 13953109657
 */
public class InitActivity extends Activity {
	private ImageView info;
	private ImageView company;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		this.requestWindowFeature(Window.FEATURE_NO_TITLE);
		getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
				WindowManager.LayoutParams.FLAG_FULLSCREEN);
		setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
		setContentView(R.layout.init);
		info = (ImageView) findViewById(R.id.info);
		company = (ImageView) findViewById(R.id.logo);
		info.setOnLongClickListener(new OnLongClickListener() {
			@Override
			public boolean onLongClick(View arg0) {
				startActivity(new Intent(getApplicationContext(),
						InfoActivity.class));
				return true;
			}
		});
		company.setOnLongClickListener(new OnLongClickListener() {
			@Override
			public boolean onLongClick(View arg0) {
				startActivity(new Intent(getApplicationContext(),
						CompanyActivity.class));
				return true;
			}
		});
	}
	@Override
	public void onConfigurationChanged(Configuration newConfig) {
		if(newConfig.orientation==Configuration.ORIENTATION_PORTRAIT){  
			newConfig = null;
		}
		super.onConfigurationChanged(newConfig);
	}
}